]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Avoid a warning
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 6 Aug 2021 16:15:40 +0000 (18:15 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 9 Aug 2021 14:08:09 +0000 (14:08 +0000)
At least the last stable release of gjs has an issue with async
handlers for custom (i.e. defined in JS) GObject signals.

The handler still works, but evoking it prints the following warning:

  JS ERROR: Error: Could not guess unspecified GValue type

We can avoid the warning by using the addAction() convenience
method, which makes for a small nice cleanup anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4531

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1938>

js/ui/appDisplay.js

index f86a7bb67876aaedd7e760c8002a61d831dac85d..012e88bd0b9bd921bc7cb7627e5a03d8ba69f839 100644 (file)
@@ -3531,8 +3531,7 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
 
             if (Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop')) {
                 this._appendSeparator();
-                let item = this._appendMenuItem(_("Show Details"));
-                item.connect('activate', async () => {
+                this.addAction(_('Show Details'), async () => {
                     let id = this._source.app.get_id();
                     let args = GLib.Variant.new('(ss)', [id, '']);
                     const bus = await Gio.DBus.get(Gio.BusType.SESSION, null);